//
//  MeZhangHaoTableViewCell.m
//  NBProduct
//
//  Created by hl on 16/5/17.
//  Copyright (c) 2016年 ping. All rights reserved.
//

#import "MeZhangHaoTableViewCell.h"

@implementation MeZhangHaoTableViewCell
-(instancetype)init{
    self = [super init];
    if (self) {
        self.signLab = [[BaseLabel alloc] initWithFrame:CGRectMake(14*_kscW, 11*_kscH, 90*_kscW, 14*_kscH) andFont:PuTongFont];
        [self.contentView addSubview:self.signLab];
        
        self.detailLab = [[BaseLabel alloc] initWithFrame:CGRectMake(self.signLab.right + 10*_kscW, self.signLab.top, KScreenWidth - self.signLab.right - 40*_kscW, self.signLab.height)];
        self.detailLab.textColor = COLOR(156, 156, 156, 1);
        self.detailLab.myfont = PuTongFont;
        self.detailLab.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:self.detailLab];
        
        _lineLab = [[UILabel alloc] initWithFrame:CGRectMake(self.signLab.left, 36*_kscH-0.8, KScreenWidth - self.signLab.left, 0.8)];
        _lineLab.backgroundColor = XiaHuaXianCOLOR;
        [self.contentView addSubview:_lineLab];
        
       
    }
    return self;
}
-(void)setSignStr:(NSString *)signStr{
    _signStr = signStr;
    if ([signStr isEqual:@"普通"]) {
        [self normalCell];
    }else if ([signStr isEqual:@"头像"]){
        [self portraitCell];
    }else if ([signStr isEqual:@"二维码"]){
        [self erWeiMaCell];
    }else if ([signStr isEqual:@"详情"]){
        [self detailCell];
    }
    
}
-(void)normalCell{
    [self.detailLab setHidden:YES];
    [self.portraitView setHidden:YES];
    
}
-(void)portraitCell{
    [self.portraitView setHidden:NO];
    
    self.signLab.frame = CGRectMake(14*_kscW, 24*_kscH, 90*_kscW, 14*_kscH);
    
    self.portraitView = [[UIImageView alloc] initWithFrame:CGRectMake(KScreenWidth - 80*_kscW, 6*_kscH, 50*_kscW, 50*_kscH)];
    self.portraitView.layer.cornerRadius = 25*_kscW;
    self.portraitView.clipsToBounds = YES;
    [self.contentView addSubview:self.portraitView];
    _lineLab.frame = CGRectMake(self.signLab.left, 60*_kscH-0.8, KScreenWidth - self.signLab.left, 0.8);
}
-(void)erWeiMaCell{
    self.erWeiMaView = [[UIImageView alloc] initWithFrame:CGRectMake(KScreenWidth - 50*_kscW, 8*_kscH, 20*_kscW, 20*_kscH)];
    self.erWeiMaView.image = [UIImage imageNamed:@"erweima"];
    [self.contentView addSubview:self.erWeiMaView];
}
-(void)detailCell{
    [self.detailLab setHidden:NO];
}
-(void)setTop:(BOOL)top{
    _top = top;
    if (top) {
       
        [self.contentView addSubview:[UILabel drawXiaHuaXianLabel:0]];
    }
}
-(void)setBottom:(BOOL)bottom{
    _bottom = bottom;
    if (bottom) {
        [_lineLab setHidden:YES];
   
        [self.contentView addSubview:[UILabel drawXiaHuaXianLabel:36*_kscH - 0.5]];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
